package com.stm.bi.service;

import com.stm.framework.model.CustomizePage;
import com.stm.framework.dto.Response;
import org.springframework.stereotype.Service;
import jakarta.annotation.Resource;
import java.util.List;
import com.stm.bi.dto.vo.SubjectVO;
import com.stm.bi.dto.vo.SubjectCategoryInfoVO;
import com.stm.bi.dto.query.SubjectListQry;
import com.stm.bi.dto.query.SubjectPageQry;
import com.stm.bi.dto.cmd.SubjectAdd;
import com.stm.bi.dto.cmd.SubjectUpd;
import com.stm.bi.executor.SubjectQueryExe;
import com.stm.bi.executor.SubjectSaveExe;

/**
* 科目-服务
*
* @author qinyongjie
 * @date 2025-05-22
 */
@Service
public class SubjectService {
    @Resource
    private SubjectQueryExe subjectQueryExe;
    @Resource
    private SubjectSaveExe subjectSaveExe;
    /**
    * 查询单条
    * @param id
    */
    public Response<SubjectVO> selectById(Long id) {
        return subjectQueryExe.selectById(id);
    }

   /**
    * 查询列表
    * @param subjectListQry
    */
    public Response<List<SubjectVO>> selectList(SubjectListQry subjectListQry) {
        return subjectQueryExe.selectList(subjectListQry);
    }

    /**
    * 查询页面
    * @param subjectPageQry
    */
    public Response<CustomizePage<SubjectVO>> selectPage(SubjectPageQry subjectPageQry) {
        return subjectQueryExe.selectPage(subjectPageQry);
    }

    /**
    * 保存
    * @param subjectAdd
    */
    public Response create(SubjectAdd subjectAdd) {
        return subjectSaveExe.create(subjectAdd);
    }

    /**
    * 更新
    * @param subjectUpd
    */
    public Response update(SubjectUpd subjectUpd) {
         return subjectSaveExe.update(subjectUpd);
    }

    /**
     * 通过归属分类ID查询科目信息
     * @param categoryId 归属分类ID
     */
    public Response<List<SubjectCategoryInfoVO>> selectByCategoryId(Long categoryId) {
        return subjectQueryExe.selectByCategoryId(categoryId);
    }
}
